/**********************************************************/
/* Goblin Defense - A tower defense game for Wii Homebrew */
/* Copyright (C) 2009 Ricardo Bueno Cordeiro              */
/* Licensed under de GNU General Public License v2.0      */
/*   See license_gplv2.txt for detalis                    */
/**********************************************************/

#include <gccore.h>
#include "area_item.h"

int AreaItem::near(AreaItem *a1, AreaItem *a2) {
	f32 x1 = a1->get_x();
	f32 y1 = a1->get_y();
	f32 r1 = a1->get_radius();

	f32 x2 = a2->get_x();
	f32 y2 = a2->get_y();
	f32 r2 = a2->get_radius();

	return (((x1 - x2) * (x1 - x2)) + ((y1 - y2) * (y1 - y2))) < (r1 * r1 + 2 * r1 * r2 + r2 * r2);
}

int AreaItem::higher_priority(AreaItem *a1, AreaItem *a2) {
	return a1->get_priority() < a2->get_priority();
}
